package com.weixing.mall.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.provider.api.model.vo.ProductStockVo;
import com.weixing.mall.provider.model.domain.ProductStock;
import com.weixing.mall.provider.model.query.ProductStockExistQuery;
import com.weixing.mall.provider.model.query.ProductStockQuery;
import com.weixing.mall.provider.model.vo.ProductStockListVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 仓库模块-商品库存表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-15
 */
public interface ProductStockMapper extends BaseMapper<ProductStock> {

    IPage<ProductStockListVo> selectOfPage(@Param("pg") Page page, @Param("qs") ProductStockQuery productStockQuery);

    Map<String,Object> totalQuantityAndAmount(@Param("qs") ProductStockQuery productStockQuery);

    List<ProductStockListVo> selectOfPage(@Param("qs") ProductStockQuery productStockQuery);
    int selectTotalNum(@Param("productId")Long productId,@Param("depotId")Long depotId);

    ProductStockVo selectProductStock( @Param("qs")ProductStockExistQuery productStockExistQuery);

    List<ProductStockVo> getAllByDepotId(Long  depotId);

    List<ProductStockVo> getAllAvaByDepotId(Long  depotId);

    ProductStock  findProductStock(@Param("productId")Long productId,@Param("storehouse")String storehouse,@Param("stockSn")String  stockSn);

}
